<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>MSG -- Meteosat Second Generation</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body style="background-color: rgb(255, 255, 255);">

<h1>MSG -- Meteosat Second Generation</h1>

<p>This driver implements reading support for Meteosat Second
Generation files. These are files with names like
H-000-MSG1__-MSG1________-HRV______-000007___-200405311115-C_, commonly
distributed into a folder structure with dates (e.g. 2004\05\31 for the file mentioned).</p>

<p>The MSG files are wavelet-compressed. A decompression library licensed from <a href="http://www.eumetsat.int/">EUMETSAT</a> is needed
(<a href="http://www.eumetsat.int/Home/Main/Access_to_Data/User_Support/SP_1117714787347">Public Wavelet Transform Decompression Library Software</a>,
shorter <em>Wavelet Transform Software</em>).
The software is compilable on Microsoft Windows, Linux and Solaris Operating Systems, and it works on 32 bits and 64 bits as well as mixed architectures.
It is a licensed software and available free to download upon acceptance of the WaveLet Transform Software Licence during electronic registration process.
</p>


<p>Part of the source of the file xrithdr_extr.c from XRIT2PIC is used to
parse MSG headers. This source is licensed under the terms of the GNU
General Public License as published by the Free Software Foundation.
</p>

<p>This driver is not "enabled" by default. See <a href="#MSG_Build_Instructions">Build Instructions</a> on how to include this driver in your GDAL library.<br>

<h2>Build Instructions</h2>
<a name="MSG_Build_Instructions"></a>

<p>Download the Eumetsat library for wavelet decompression. This is a
file named PublicDecompWT.zip. Extract the content in a subdirectory with
the same name (under frmts/msg).</p>

<p>If you are building with Visual Studio
6.0, extract the .vc makefiles for the PublicDecompWT from the file
PublicDecompWTMakefiles.zip.</p>

<p>If you build using the GNUMakefile, use <em>--with-msg</em> option to enable MSG driver:</p>

<pre>./configure --with-msg</pre>

<p>If find that some adjustments are needed in the makefile and/or the msg
source files, please "commit" them. The Eumetsat library promises to be
"platform independent", but as we are working with Microsoft Windows
and Visual Studio 6.0, we did not have the facilities to check if the
rest of the msg driver is. Furthermore, apply steps 4 to 7 from the <a href="http://www.gdal.org/gdal_drivertut.html">GDAL Driver Implementation Tutorial</a>, section "Adding Driver to GDAL Tree".
</p>

<p>MSG Wiki page is available at <a href="http://trac.osgeo.org/gdal/wiki/MSG">http://trac.osgeo.org/gdal/wiki/MSG</a>.
It's dedicated to document building and usage hints
</p>

<h2>Specification of Source Dataset</h2>

<p>It is possible to select individual files for opening. In this case,
the driver will gather the files that correspond to the other strips of
the same image, and correctly compose the image.
</p>

<p>Example with gdal_translate.exe:</p>
<pre>
gdal_translate
 C:\hrit_a\2004\05\31\H-000-MSG1__-MSG1________-HRV______-000008___-200405311115-C_
 C:\output\myimage.tif
</pre>

<p>It is also possible to use the following syntax for opening the MSG files:</p>

<ul>
  <li>MSG(source_folder,timestamp,(channel,channel,...,channel),use_root_folder,data_conversion,nr_cycles,step)</li>
  <li>
      <ul>
        <li>source_folder: a path to a folder structure that contains the files</li>
        <li>timestamp: 12 digits representing a date/time that identifies the 114 files of the 12 images of that time, e.g. 200501181200</li>
        <li>channel: a number between 1 and 12, representing each of the 12 available channels. When only specifying one channel, the brackets are optional.</li>
        <li>use_root_folder: Y to indicate that the files reside directly into the source_folder specified. N to indicate that the files reside in date structured folders: source_folder/YYYY/MM/DD</li>
        <li>data_conversion:</li>
        <li>
            <ul>
              <li>N to keep the original 10 bits DN values. The result is UInt16.</li>
              <li>B to convert to 8 bits (handy for GIF and JPEG images). The result is Byte.</li>
              <li>R to perform radiometric calibration and get the result in mW/m2/sr/(cm-1)-1. The result is Float32.</li>
              <li>L to perform radiometric calibration and get the result in W/m2/sr/um. The result is Float32.</li>
              <li>T to get the reflectance for the visible bands (1, 2, 3 and 12) and the temperature in degrees Kelvin for the infrared bands (all other bands). The result is Float32.</li>
            </ul>
        </li>
        <li>nr_cycles: a number that indicates the number of consecutive cycles to be included in the same file (time series). These are appended as additional bands.</li>
        <li>step: a number that indicates what is the stepsize when multiple cycles are chosen. E.g. every 15 minutes: step = 1, every 30 minutes: step = 2 etc. Note that the cycles are exactly 15 minutes apart, so you can not get images from times in-between (the step is an
    integer).</li>
      </ul>
  </li>
</ul>


<p>Examples with gdal_translate utility:</p>

<p>Example call to fetch an MSG image of 200501181200 with bands 1, 2 and 3 in IMG format:</p>
<pre>
gdal_translate -of HFA MSG(\\pc2133-24002\RawData\,200501181200,(1,2,3),N,N,1,1) d:\output\outfile.img
</pre>

<p>In JPG format, and converting the 10 bits image to 8 bits by dividing all values by 4:</p>
<pre>
gdal_translate -of JPEG MSG(\\pc2133-24002\RawData\,200501181200,(1,2,3),N,B,1,1) d:\output\outfile.jpg
</pre>

<p>The same, but reordering the bands in the JPEG image to resemble RGB:</p>
<pre>
gdal_translate -of JPEG MSG(\\pc2133-24002\RawData\,200501181200,(3,2,1),N,B,1,1) d:\output\outfile.jpg
</pre>

<p>Geotiff output, only band 2, original 10 bits values:</p>
<pre>
gdal_translate -of GTiff MSG(\\pc2133-24002\RawData\,200501181200,2,N,N,1,1) d:\output\outfile.tif
</pre>

<p>Band 12:</p>
<pre>
gdal_translate -of GTiff MSG(\\pc2133-24002\RawData\,200501181200,12,N,N,1,1) d:\output\outfile.tif
</pre>

<p>The same band 12 with radiometric calibration in mW/m2/sr/(cm-1)-1:</p>
<pre>
gdal_translate -of GTiff MSG(\\pc2133-24002\RawData\,200501181200,12,N,R,1,1) d:\output\outfile.tif
</pre>

<p>Retrieve data from c:\hrit-data\2005\01\18 instead of \\pc2133-24002\RawData\... :</p>
<pre>
gdal_translate -of GTiff MSG(c:\hrit-data\2005\01\18,200501181200,12,Y,R,1,1) d:\output\outfile.tif
</pre>

<p>Another option to do the same (note the difference in the Y and the N for the &#8220;use_root_folder&#8221; parameter:</p>
<pre>
gdal_translate -of GTiff MSG(c:\hrit-data\,200501181200,12,N,R,1,1) d:\output\outfile.tif
</pre>

<p>Without radiometric calibration, but for 10 consecutive cycles (thus from 1200 to 1415):</p>
<pre>
gdal_translate -of GTiff MSG(c:\hrit-data\,200501181200,12,N,N,10,1) d:\output\outfile.tif
</pre>

<p>10 cycles, but every hour (thus from 1200 to 2100):</p>
<pre>
gdal_translate -of GTiff MSG(c:\hrit-data\,200501181200,12,N,N,10,4) d:\output\outfile.tif
</pre>

<p>10 cycles, every hour, and bands 3, 2 and 1:</p>
<pre>
gdal_translate -of GTiff MSG(c:\hrit-data\,200501181200,(3,2,1),N,N,10,4) d:\output\outfile.tif
</pre>


<h2>Georeference and Projection</h2>

<p>The images are using the Geostationary Satellite View projection. Most
GIS packages don't recognize this projection (we only know of ILWIS
that does have this projection), but gdalwarp.exe can be used to
re-project the images.</p>

<p>See Also:</p>

<ul>
    <li>Implemented as <tt>gdal/frmts/msg/msgdataset.cpp</tt>.</li>
    <li><a href="http://www.eumetsat.int">http://www.eumetsat.int</a> - European Organisation for the Exploitation of Meteorological Satellites</li>
</ul>

</body>
</html>
